#include "NamespaceNode.h"

#include "Output/Console.h"
#include "ScriptCompiler/Token/Token.h"
#include  "ScriptCompiler/AST/AccessLevelNode.h"
#include  "ScriptCompiler/AST/DecoratorNode.h"
#include  "ScriptCompiler/AST/UsingNode.h"
#include  "ScriptCompiler/AST/ClassNode.h"
#include  "ScriptCompiler/AST/DelegateNode.h"
#include  "ScriptCompiler/AST/EnumNode.h"
#include  "ScriptCompiler/AST/FunctionNode.h"
#include  "ScriptCompiler/AST/FieldNode.h"
#include  "ScriptCompiler/AST/PropertyNode.h"
#include  "ScriptCompiler/AST/ParameterNode.h"
#include  "ScriptCompiler/AST/SentenceBlockNode.h"
#include  "ScriptCompiler/AST/ExpressionNode.h"
#include  "ScriptCompiler/AST/NamespaceNode.h"

void CNamespaceNode::DebugPrint(int32_t InDepth)
{
    //print depth
    for(int32_t i=0;i<InDepth;i++)
    {
        WH::Print(U"\t");
    }

    if(!NameChain.Empty()) 
    {
        //print namespace name chain
        WH::Print(U"namespace ");
        for(auto& Name : NameChain)
        {
            WH::Print(Name->ToString());
            WH::Print(U".");
        }
        WH::Print(U"\n");

        //print { with depth
        for(int32_t i=0;i<InDepth;++i)
        {
            WH::Print(U"\t");
        }
        WH::Print(U"{\n");
    }

    //print using
    for(auto& Using : Usings)
    {
        Using->DebugPrint(InDepth+1);
    }

    //print  classes
    for(auto& Class : Classes)
    {
        Class->DebugPrint(InDepth+1);
    }


    //print  delegates
    for(auto& Delegate : Delegates)
    {
        Delegate->DebugPrint(InDepth+1);
    }

    //print  enums
    for(auto& Enum : Enums)
    {
        Enum->DebugPrint(InDepth+1);
    }

    //print  namespaces
    for(auto& Namespace : Namespaces)
    {
        Namespace->DebugPrint(InDepth+1);
    }

    if(!NameChain.Empty()) 
    {
        //print } with depth
        for(int32_t i=0;i<InDepth;++i)
        {
            WH::Print(U"\t");
        }
        WH::Print(U"}\n");
    }
}
